package com.yvnze.ydyp.modules.document.controller;


import com.yvnze.ydyp.common.enums.ErrorCodeEnum;
import com.yvnze.ydyp.common.exception.SysException;
import com.yvnze.ydyp.modules.document.dto.FileInfoDirectoryDto;
import com.yvnze.ydyp.modules.document.service.IFileInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Haipeng Wang  
 * @since 2021-08-14
 */
@RestController
@RequestMapping("/document")
public class FileInfoController {

    @Autowired
    IFileInfoService fileInfoService;

    /**
     * 根据传入的笔记本path 获取对应的笔记本目录列表
     * @return
     */
    @ApiOperation(value = "获取笔记列表",notes = "根据传入的用户path 和 笔记path 返回对应的笔记列表")
    @GetMapping("/{userSpace}/{noteSpace}")
    public List<FileInfoDirectoryDto> listDirectory(@PathVariable(name = "userSpace")String userSpace,
                                                    @PathVariable(name = "noteSpace") String noteSpace){
        /**
         * 把userSpace 和 notespace 放入redis 中
         * 设置内存命中
         */
    }
}

